<template>
  <div class="box">
    <div class="title">
      <div class="el-icon-arrow-left" @click="$router.go(-1)"></div>
      <div>我的活动</div>
      <div @click="$router.push({path:'/listactivitiesHistory'})"
           class="title_right_size">历史
      </div>
    </div>

    <div v-show="dataList.length>0" class="card_back" v-for="item in dataList" :key="item.ROW_NUMBER">
      <div class="card_back_left">
        <img src="../../../../assets/static/Consumption/q1.png" alt="">
        <div>
          <div>{{ item.device_name }}</div>
          <div>{{ item.create_time }}</div>
        </div>
      </div>
      <img src="../../../../assets/static/activitiesHistory/5.png" alt="">
    </div>
    <div v-show="dataList.length===0" class="height_flex">
      <div class="height_flex_img">
        <img src="../../../../assets/static/activities/box.png" alt="">
        <div class="height_flex_size">还没有任何活动！</div>
        <div>当您使用我们的服务时，会在这里看到活动。</div>
      </div>
    </div>
  </div>
</template>

<script>
import {index} from '@/api/merbership/activity'

export default {
  data() {
    return {
      dataList: []
    }
  },
  mounted() {
    this.index()
  },
  methods: {
    /**
     * 我的活动
     */
    index() {
      const pd = {}
      index(this.$qs.stringify(pd))
        .then(res => {
          this.dataList = res.data.data.data
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.box {

  /* 标题 */
  .title {
    background-color: #7ac91b;
    color: #fff;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    font-weight: bold;

    .el-icon-arrow-left {
      float: left;
      margin-top: 5px;
    }

    .title_right_size {
      font-size: 12px;
      font-weight: normal;
    }
  }

  .height_flex {
    height: 90vh;
    display: flex;
    align-items: center;

    .height_flex_img {
      font-size: 11px;
      color: #999;
      width: 100%;
      text-align: center;

      img {
        width: 170px;
      }

      .height_flex_size {
        font-size: 14px;
        color: #333;
        font-weight: bold;
        margin: 20px 0 12px 0;
      }
    }
  }

  /*  */
  .card_back {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
  }

  .card_back img {
    width: 57px;
  }

  .card_back_left img {
    width: 45px;
    margin-right: 10px;
    margin-top: 5px;
  }

  .card_back_left {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #999999;
    font-weight: normal;
  }

  .card_back_left > div > div:nth-child(1) {
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: bold;
    color: #333333;
  }
}
</style>
